home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8580 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.0 KB  |  96 lines

  1. Newsgroups: comp.lang.c++
  2. Path: natlab.research.philips.com!ijntema
  3. From: ijntema@natlab.research.philips.com (Hans IJntema)
  4. Subject: Re: Borland C++ floating point overflow - Help!
  5. Sender: news@natlab.research.philips.com (USENET News System)
  6. Message-ID: <ijntema.236.01B6FB8D@natlab.research.philips.com>
  7. Date: Thu, 15 Feb 1996 15:32:49 GMT
  8. References: <4febl6$5ei@news.acns.nwu.edu> <4fruk3$73t@adam.telalink.net>
  9. Organization: Philips Research
  10. X-Newsreader: Trumpet for Windows [Version 1.0 Rev B]
  11.  
  12. In article <4fruk3$73t@adam.telalink.net> daver@nashville.net (David Rawle) writes:
  13. >From: daver@nashville.net (David Rawle)
  14. >Subject: Re: Borland C++ floating point overflow - Help!
  15. >Date: 14 Feb 1996 06:14:27 GMT
  16.  
  17. >In article <4febl6$5ei@news.acns.nwu.edu>, msypherd@merle.acns.nwu.edu 
  18. >says...
  19. >>
  20. >>Thanks for helping - 
  21. >>
  22. >>        I am runing Borland 4.51 / 4.52 on my P90/16MB  with a Gigabyte 
  23. >>motherboard and Award BIOS 4.50<something>.  I am having problems simply 
  24. >>entering a floating point number.  Every time I do, I get "Floating 
  25. >Point: 
  26. >>Overflow"
  27. >>
  28. >>For example,
  29. >>
  30. >>#include <iostream.h>
  31. >>main()
  32. >>{
  33. >>        float x;
  34. >>        cin >> x;
  35. >>        cout << "It doesn't make it this far when I run it";
  36. >>        reutrn 0;
  37. >>}
  38. >>
  39. >>        The program compiles fine, but when I run it, I run into 
  40. >problems.  If 
  41. >>I enter a floating point number, I get the error and the program quits.  
  42. >If I 
  43. >>enter an int into the float variable 'x', everything works fine.
  44.  
  45.  
  46.  
  47. Add somewher a float calculation, e.g. float a = 1.0/2.0;
  48. Borland C sometimes 'forget' (or optimizes too much) to link the floating 
  49. point lib when you are not using float calculations. For reading a float from 
  50. standard input it needs the float lib, which is not linked......
  51.  
  52.  
  53.  
  54.  
  55. >>        Also, if I put a floating point number into an int variable, 
  56. >instead 
  57. >>of discarding the decimal part, I get a a bizzarre looping of output 
  58. >statments 
  59. >>that lock up the program.
  60. >>
  61. >>        Is this a problem with my Computer, or do I have some setting set 
  62. >>incorrectly?  Any help would be appreciated.
  63. >>
  64. >>        I'd rather not pay the 900 number fees for Borland tech support. 
  65. > I 
  66. >>think the should at least help me get the program running for the price I 
  67. >>paid.  Maybe I'm just an optimist.
  68. >>
  69. >>        Thanks again,
  70. >>
  71. >>        Matthew C. Sypherd
  72. >>        ------------------
  73. >>        msypherd@nwu.edu
  74. >>
  75. >>p.s.  If you could, please post and e-mail any reply - in case I miss the 
  76. >>header.  
  77.  
  78.  
  79. >How are you building this project?  You might need to call
  80. >_InitEasyWin() first thing in main to initialize stdio. What is the
  81. >value you are trying to enter?
  82.  
  83.  
  84. ___________________________________________________________________________
  85. Hans IJntema
  86. Philips Research
  87. Building WO-02
  88. Prof. Holstlaan 4
  89. 5656 AA Eindhoven
  90. The Netherlands
  91.  
  92. e-mail: ijntema@natlab.research.philips.com
  93. Phone:  +31 40 2743325 or 2742877 
  94. Fax:    +31 40 2742630
  95. ___________________________________________________________________________
  96.